public class NGuessNumber {
    int [] answer = new int [4];

    public int [] generateAnswer(){
        answer[0] = (int)(Math.random()*10);
        answer[1] = (int)(Math.random()*10);
        answer[2] = (int)(Math.random()*10);
        answer[3] = (int)(Math.random()*10);
        return answer;
    }

    public static void main(String[] args) {
        NGuessNumber ngn = new NGuessNumber();
        int [] answers = ngn.generateAnswer();
        for(int i = 0;i < answers.length; i++){
            System.out.println(answers[i]);
        }
    }
}